import { Navigate, useRoutes } from "react-router-dom";
import Home from "@/views/home/index.tsx";
import lazyLoad from './utils/lazyLoad.tsx'
import React from "react";

export const rootRouter = [
  {
    path:'/',
    element:<Navigate to="/login"/>
  },
  {
    path:'/login',
    element:lazyLoad(React.lazy(()=>import('@/views/login/login.tsx'))),
    meta:{
      requireAuth:false,
      title:'首页',
      keyL:'login'
    }
  },
  {
    path:'/home',
    element:<Home/>
  }
]


const Router = ()=>{
  const routes = useRoutes(rootRouter)
  return routes
}

export default Router